-
Notifications
You must be signed in to change notification settings - Fork 1.6k
chore: Extended BaseMessage to support reasoning fields and updated usage accounting in streaming mode #3326
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the ✨ Finishing touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Wendong-Fan
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this PR didn't fixed the issue calling deepseek reasoner model with stream=True and GET_REASONING_CONTENT=True
|
updated cc @Wendong-Fan |
Wendong-Fan
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please remove model specific logic added to ChatAgent
|
@Wendong-Fan hi,based on our previous disscussion ,we should hanlde thinking content in model level. however ,after further further consideration, i realized that if we want to keep the original response structure,for example, the api returns results that separate thinking and conent,then we should this structure at model level. Once we retain this strcuture at model level, we inevitably need a set of processing logic in the chatagent. therefor , i will continue in the existing manner. |
Saedbhati
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM @fengju0213! Could you provide me a model that supports the reasoning_content field for testing purposes?”
@Saedbhati thanks for review!you can use deepseek-reasoner to test it, if you need apikey, you can send me a message in slack |
|
Hey @Saedbhati, have you run the example files shall I go ahead and merge |
hi @waleedalzarooni the key I gave you should be sufficient to run this example, right? Feel free to message me if you have any questions. |
|
@waleedalzarooni Go head and merge LGTM! |
Description
Describe your changes in detail (optional if the linked issue already contains a detailed description of the changes).
assistant text (and even during streaming). We plumb that trace directly
into BaseMessage so both batch and streaming callers can reliably access the
thinking process without scraping metadata.
deltas in inconsistent ways. We updated the stream processors to apply usage
updates regardless of whether choices are present, ensuring final token
accounting and completion emission work across providers like OpenAI, Gemini,
and Qwen.
Checklist
Go over all the following points, and put an
xin all the boxes that apply.Fixes #issue-numberin the PR description (required)pyproject.tomlanduv lockIf you are unsure about any of these, don't hesitate to ask. We are here to help!